﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NGinn"
    targetNamespace="http://www.nginn.org/WorkflowDefinition.1_0.xsd"
    elementFormDefault="qualified"
    xmlns="http://www.nginn.org/WorkflowDefinition.1_0.xsd"
    xmlns:mstns="http://www.nginn.org/WorkflowDefinition.1_0.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:complexType name="ExtensionProperties">
    <xs:annotation>
      <xs:documentation>Storage for custom properties - application extensions etc.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="property">
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:string">
              <xs:attribute name="name" use="required" type="xs:string" />
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  
  <!-- definition of type set -->
  <xs:complexType name="TypeSetDef">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="struct" type="StructDef"  />
        <xs:element name="enum" type="EnumDef" />
      </xs:choice>
    </xs:sequence>

  </xs:complexType>
  <!-- data record definition -->
  <xs:complexType name="StructDef">
    <xs:sequence>
      <xs:element name="member" type="MemberDef" minOccurs="1" maxOccurs="unbounded" />
      <xs:element name="extensionProperties" type="ExtensionProperties" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required" />
    <xs:anyAttribute namespace="##other" processContents="skip" />
  </xs:complexType>

  <!-- enum type definition -->
  <xs:complexType name="EnumDef">
    <xs:sequence>
      <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required" />
    <xs:anyAttribute namespace="##other" processContents="skip" />
  </xs:complexType>

  <!-- struct member definition -->
  <xs:complexType name="MemberDef">
    <xs:sequence>
      <xs:element name="extensionProperties" type="ExtensionProperties" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required" />
    <xs:attribute name="type" type="xs:string" use="required" />
    <xs:attribute name="required" type="xs:boolean" use="optional" />
    <xs:attribute name="isArray" type="xs:boolean" use="optional" />
    <xs:anyAttribute namespace="##other" processContents="skip" />
  </xs:complexType>

  <xs:simpleType name="VariableDir">
    <xs:restriction base="xs:string">
      <xs:enumeration value="In" />
      <xs:enumeration value="Out" />
      <xs:enumeration value="InOut" />
      <xs:enumeration value="Local" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="VariableDef">
    <xs:complexContent>
      <xs:extension base="MemberDef">
        <xs:sequence>
          <xs:element name="defaultValue" type="xs:string" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
        <xs:attribute name="dir" type="VariableDir" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  

  
  
</xs:schema>
